/*
  Copyright (c) 2010 Les Newell. All rights reserved

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program. If not, see <http://www.gnu.org/licenses/>.
*/


DEFINE_MODULE(FlightControl,Module)

    FlightControl()
    {
        AddSocket("FlightControl.Pitch",&m_axes.filtered[PITCH]);
        AddSocket("FlightControl.Roll",&m_axes.filtered[ROLL]);
        AddSocket("FlightControl.Yaw",&m_axes.filtered[YAW]);
        AddSocket("FlightControl.Throttle",&m_axes.filtered[THROTTLE]);
        AddSocket("FlightControl.Pitch.Filter",&m_axes.amounts[PITCH]);
        AddSocket("FlightControl.Roll.Filter",&m_axes.amounts[ROLL]);
        AddSocket("FlightControl.Yaw.Filter",&m_axes.amounts[YAW]);
        AddSocket("FlightControl.Throttle.Filter",&m_axes.amounts[THROTTLE]);
    }

    virtual void ParamChanged(Socket * param)
    {
    }

    virtual void Init()
    {
        m_flightMode.Connect("FlightMode.Status");
    }

    virtual void Reference()
    {
    }

    virtual void Loop(const unsigned long& interval)
    {
    }

protected:

    Plug8 m_flightMode;
    MultiFilter<MAX_COMMANDS> m_axes;
    SocketF m_throttle;
};



